package com.sunlands.qdcy.tongzhuo.repository;

import com.sunlands.qdcy.tongzhuo.model.UserDiaryZanDO;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface UserDiaryZanRepository extends JpaRepository<UserDiaryZanDO, Long>, JpaSpecificationExecutor<UserDiaryZanDO> {
    List<UserDiaryZanDO> findByTargetIdAndType(Long targetId, Integer type);

    UserDiaryZanDO findByTargetIdAndTypeAndZanUserId(Long targetId, Integer type, Long zanUserId);

    Long countByTargetIdAndType(Long targetId, Integer type);

}
